package com.i8office.android.zhihuixinwu.util;

import android.content.Context;
import android.support.annotation.StringRes;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

import com.i8office.android.zhihuixinwu.R;

/**
 * Created by jiajia on 2018/9/8.
 */

public class ToastUtils {
    public static void showCollectToast(Context context, @StringRes int info) {
        Toast toast = new Toast(context);
        toast.setGravity(Gravity.CENTER,0,0);
        View view = LayoutInflater.from(context).inflate(R.layout.toast_collect,null);
        ((TextView)view.findViewById(R.id.message)).setText(info);
        toast.setView(view);
        toast.setDuration(Toast.LENGTH_SHORT);
        toast.show();
    }
}
